import request from '#/utils/requestAbort';
//电价分析
export async function getElectricityAnalysis(params) {
  const url =
    params.marketId === 'PDBLJ'
      ? '/private-business/stationProvincialClearing/electricityAnalysis'
      : '/predictive/information/electricityAnalysis';
  return request(url, {
    method: 'POST',
    data: params,
  });
}

// //供需分析
// export async function getSupplyAndDemandAnalysis(params) {
//   return request('/predictive/information/supplyAndDemandAnalysis', {
//     method: 'POST',
//     data: params,
//   });
// }

// //供需分析导出
// export async function getSupplyAndDemandData(params) {
//   return request('/fanrun/information/supplyAndDemandAnalysisExport', {
//     method: 'POST',
//     data: params,
//     responseType: 'blob',
//     getResponse: true,
//   });
// }

// export async function getTradingSupplyAndDemandAnalysis(params) {
//   return request('/fanrun/information/tradingSupplyAndDemandAnalysis', {
//     method: 'POST',
//     data: params,
//   });
// }

export async function getForecaseTradingSupplyAndDemandAnalysis(params) {
  const url =
    params.marketId === 'PDBLJ'
      ? '/private-business/marketSupplyAndDemand/supplyAndDemandAnalysis'
      : '/predictive/regionForecast/tradingSupplyAndDemandAnalysis';
  return request(url, {
    method: 'POST',
    data: params,
  });
}

//供需分析导出
export async function getTradingSupplyAndDemandData(params) {
  return request('/fanrun/information/tradingSupplyAndDemandAnalysisExport', {
    method: 'POST',
    data: params,
    responseType: 'blob',
    getResponse: true,
  });
}

//电价预测查询
export async function getDataList(params) {
  const url =
    params.marketId === 'PDBLJ'
      ? '/algorithm-business/spotPriceForecast/getDayAheadForecastPrice'
      : '/predictive/information/electricityForecastPrice';
  return request(url, {
    method: 'POST',
    data: params,
  });
}
//次新电价预测查询
export async function nextElectricityForecastPrice(params) {
  return request('/predictive/information/nextElectricityForecastPrice', {
    method: 'POST',
    data: params,
  });
}
// 省份-交易中心-场站（数据权限）
export async function queryMarketList(menuCode) {
  return request(`/power/dataPower/common/${menuCode}/t_station`, {
    method: 'GET',
  });
}
